﻿#region Copyright Info

// 
// Majesty of Omega - The next evolution of macro management space strategy
// 
// Copyright 2007-2009 André Claaßen
// 
// This file is protected by the terms and conditions of the
// Microsoft Community License (Ms-CL 1.1), a copy of which should
// have been distributed along with this software. If not,
// you may find the license information at the following URL:
// 
// http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx

#endregion

#region

using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

#endregion

namespace Majesty_of_Omega.GUI.Controls
{
    /// <summary>
    /// The Setup Panel is a Group Control in various setup screens. Beside an altered visualization, the 
    /// Setup panel provides a Location property. The location exists for better rendering purposes. It steers the
    /// round corners of the panel
    /// </summary>
    /// <remarks>
    /// The whole visualization lies in Themes/Generic.xaml
    /// </remarks>
    public class SetupPanelControl : HeaderedContentControl
    {
        /// <summary>
        /// Constructs the <see cref="SetupPanelControl"/> class.
        /// </summary>
        static SetupPanelControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof (SetupPanelControl),
                                                     new FrameworkPropertyMetadata(typeof (SetupPanelControl)));
        }

        /// <summary>
        /// Location of the Panel. This Report triggers the rounded boundaries of the border 
        /// see also file generic.xaml
        /// </summary>
        public enum PanelLocation
        {
            /// <summary>
            /// The Panel ist on the top. Display rounded Corners on the left top and right top corners
            /// </summary>
            Top,
            /// <summary>
            /// The Panel is in the middle of the screen: No rounded corners
            /// </summary>
            Middle,
            /// <summary>
            /// The Panel is on the bottom of the screen.
            /// </summary>
            Bottom,
            /// <summary>
            /// The Panel is on the right of the screen.
            /// </summary>
            Right,
            /// <summary>
            /// The Panel is on the left of the screen.
            /// </summary>
            Left
        }


        /// <summary>
        /// Color of the title background
        /// </summary>
        public Brush TitleBackground
        {
            get { return (Brush) GetValue(TitleBackgroundProperty); }
            set { SetValue(TitleBackgroundProperty, value); }
        }

        /// <summary>
        /// Dependency Report for Color of the title background
        /// </summary>
        public static readonly DependencyProperty TitleBackgroundProperty =
            DependencyProperty.Register("TitleBackground", typeof (Brush), typeof (SetupPanelControl));

        /// <summary>
        /// The location dependency property determines the visualization of the borders of the panel.
        /// </summary>
        /// <seealso cref="PanelLocation"/>
        public PanelLocation Location
        {
            get { return (PanelLocation) GetValue(LocationProperty); }
            set { SetValue(LocationProperty, value); }
        }

        /// <summary>
        /// The location dependency property determines the visualization of the borders of the panel.
        /// </summary>
        /// <seealso cref="PanelLocation"/>
        public static readonly DependencyProperty LocationProperty =
            DependencyProperty.Register("Location", typeof (PanelLocation), typeof (SetupPanelControl),
                                        new UIPropertyMetadata(PanelLocation.Top));
    }
}